// Decompiled by Jad v1.5.8g. Copyright 2001 Pavel Kouznetsov.
// Jad home page: http://www.kpdus.com/jad.html
// Decompiler options: packimports(3) 

package com.nnee.p_pr.p_activity.p_view;

import android.graphics.Rect;
import android.os.*;
import android.view.View;

// Referenced classes of package com.nnee.p_pr.p_activity.view:
//            PRISGridView

class at
{

    public at(cls_PRISGridView prisgridview, View view, Rect rect, Rect rect1)
    {
        r = prisgridview;
        super();
        c = view;
        d = rect;
        e = rect1;
        a = false;
        b = false;
        e();
    }

    private void e()
    {
        boolean flag = false;
        g = Math.abs(e.left - d.left);
        h = Math.abs(e.top - d.top);
        boolean flag1;
        if(e.left - d.left >= 0)
            flag1 = true;
        else
            flag1 = flag;
        n = flag1;
        if(e.top - d.top >= 0)
            flag = true;
        o = flag;
        if(g > h)
            f = g;
        else
            f = h;
        if(f == 0)
        {
            a = true;
        } else
        {
            k = d.left;
            l = d.top;
            i = k;
            j = l;
            p = 50;
            q = f / 5;
        }
    }

    public boolean a()
    {
        boolean flag;
        if(!a && !b)
            flag = true;
        else
            flag = false;
        return flag;
    }

    public void b()
    {
        if(g >= h)
        {
            int j1;
            if(f >= p)
            {
                Message message;
                Bundle bundle;
                if(n)
                    i = i + p;
                else
                    i = i - p;
                f = f - p;
            } else
            {
                if(n)
                    i = i + f;
                else
                    i = i - f;
                f = 0;
                a = true;
            }
            j1 = ((g - f) * h) / g;
            if(o)
                j = j1 + l;
            else
                j = l - j1;
            p = p + q;
        }
        if(h > g)
        {
            int i1;
            if(f >= p)
            {
                if(o)
                    j = j + p;
                else
                    j = j - p;
                f = f - p;
            } else
            {
                if(o)
                    j = j + f;
                else
                    j = j - f;
                f = 0;
                a = true;
            }
            i1 = ((h - f) * g) / h;
            if(n)
                i = i1 + k;
            else
                i = k - i1;
            p = p + q;
        }
        message = PRISGridView.c(r).obtainMessage(-1, c);
        bundle = new Bundle();
        bundle.putInt("left", i);
        bundle.putInt("top", j);
        bundle.putInt("right", i + c.getWidth());
        bundle.putInt("bottom", j + c.getHeight());
        message.setData(bundle);
        PRISGridView.c(r).sendMessage(message);
    }

    public boolean c()
    {
        return a;
    }

    public void d()
    {
        b = true;
    }

    private static final int s = 50;
    boolean a;
    boolean b;
    View c;
    Rect d;
    Rect e;
    int f;
    int g;
    int h;
    int i;
    int j;
    int k;
    int l;
    int m;
    boolean n;
    boolean o;
    int p;
    int q;
    final PRISGridView r;
}
